﻿using System;
using System.Collections.Generic;
using System.IO.Packaging;

namespace OPCDiffCore
{
    /// <summary>
    /// Store all the differences between two OPC packages.
    /// </summary>
    public sealed class PackageDiff
    {
        private PartDiffCollection mPartsDiff = new PartDiffCollection();
        public PartDiffCollection PartDiffs
        {
            get { return mPartsDiff; }
        }

        /// <summary>
        /// Gets the number of part diff.
        /// </summary>
        public int CountPartDiff
        {
            get { return mPartsDiff.Count; }
        }
        
        /// <summary>
        /// Gets the total number diff element contain in all the part diff 
        /// (insertion, deletion, change).
        /// </summary>
        public int CountTotalDiffElement
        {
            get {
                int retCount = 0;
                foreach (PartDiff pDiff in mPartsDiff)
                {
                    foreach (DiffElement diffEleme in pDiff)
                    {
                        ++retCount;
                    }
                }
                return retCount;
            }
        }

        // TODO : Put other package info (original package path, diff package path)

        public PackageDiff(PartDiffCollection partsDiffs)
        {
            this.mPartsDiff = partsDiffs;
        }
    }
}
